<link href="__CDN__/assets/addons/weixin/css/keyword_reply.css?v={$site['version']}" rel="stylesheet"/>
<style>
    .help-block {
        color: #999;
        font-size: 12px;
        margin-bottom: 5px;
    }
</style>
<form id="add-form" class="form-horizontal hide" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('关键词类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[event_type]-ordinary">
                    <input id="row[event_type]-ordinary" name="row[event_type]" type="radio" value="ordinary" checked /> 关键词回复
                </label>
                <label for="row[event_type]-default">
                    <input id="row[event_type]-default" name="row[event_type]" type="radio" value="default" /> 万能关键词
                </label>
                <label for="row[event_type]-subscribe">
                    <input id="row[event_type]-subscribe" name="row[event_type]" type="radio" value="subscribe" /> 关注回复
                </label>
            </div>
            <span class="help-block">用户输入时没有任何匹配将回复万能关键词内容</span>
        </div>
    </div>
    <div class="form-group" data-favisible="event_type=ordinary">
        <label class="control-label col-xs-12 col-sm-2">{:__('Keyword')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-keyword" class="form-control" data-role="tagsinput" data-tagsinput-options='{"maxTags":10, "maxChars":64,"trimValue":true}' name="row[keyword]" type="text" value="">
            <span class="help-block">输入后按“回车键”确认，最多添加10个关键词</span>
        </div>
    </div>
    <div class="form-group" data-favisible="event_type=ordinary">
        <label class="control-label col-xs-12 col-sm-2">{:__('匹配方式')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[matching_type]-1">
                    <input id="row[matching_type]-1" name="row[matching_type]" type="radio" value="1" checked /> 全匹配
                </label>
                <label for="row[matching_type]-2">
                    <input id="row[matching_type]-2" name="row[matching_type]" type="radio" value="2" /> 模糊匹配
                </label>
                <span class="help-block">模糊匹配时，关键词部分匹配用户输入的内容即可</span>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Reply_type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                {foreach name="replyTypeList" item="vo"}
                <label for="row[reply_type]-{$key}"><input id="row[reply_type]-{$key}" name="row[reply_type]" type="radio" value="{$key}" {in name="key" value="text"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>
        </div>
    </div>
    <div class="form-group" data-favisible="reply_type='text'">
        <label class="control-label col-xs-12 col-sm-2">{:__('回复内容')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content-text" style="height: 200px;" data-rule="required" aria-invalid="true" class="form-control" name="row[content][text]"></textarea>
            {include file="weixin/reply/emoji" /}
        </div>
    </div>
    <div class="form-group" data-favisible="reply_type='image'">
        <label class="control-label col-xs-12 col-sm-2">{:__('上传图片')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-content-image" data-rule="required" class="form-control" size="50" name="row[content][image]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-maxsize="10M" data-input-id="c-content-image" data-mimetype="image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-content-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-maxsize="10M" data-input-id="c-content-image" data-mimetype="jpeg,png,jpg,bmp" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-content-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-content-image"></ul>
            <span class="help-block">注意：微信图片上传服务有敏感检测系统，图片含有敏感内容，上传可能失败。</span>
            <span class="help-block">临时素材有效期3天需要添加定时任务更新有效期，建议30分钟执行一次。</span>
            <span class="help-block">定时任务访问URL：{:request()->domain()}/addons/weixin/index/updateMaterial</span>
        </div>
    </div>
    <div class="form-group" data-favisible="reply_type='news'">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择图文')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-content-news" data-rule="required" data-source="weixin/news/index" data-field="title" class="form-control selectpage sp_input" name="row[content][news]" type="text" value="" autocomplete="off">
        </div>
    </div>
    <div class="form-group" data-favisible="reply_type='voice'">
        <label class="control-label col-xs-12 col-sm-2">{:__('上传音频')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-content-voice" data-rule="required" class="form-control" size="50" name="row[content][voice]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-voice" class="btn btn-danger plupload" data-maxsize="2M" data-input-id="c-content-voice" data-mimetype="mp3,amr" data-multiple="false" data-preview-id="p-content-voice"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-voice" class="btn btn-primary fachoose" data-maxsize="2M" data-input-id="c-content-voice" data-mimetype="mp3,amr" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-content-voice"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-content-voice"></ul>
            <span class="help-block">语音大小不超过2M，长度不超过60秒，支持mp3/amr格式。</span>
            <span class="help-block">临时素材有效期3天需要添加定时任务更新有效期，建议30分钟执行一次。</span>
            <span class="help-block">定时任务访问URL：{:request()->domain()}/addons/weixin/index/updateMaterial</span>
        </div>
    </div>
    <div class="form-group" data-favisible="reply_type='video'">
        <label class="control-label col-xs-12 col-sm-2">{:__('上传视频')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-content-video" data-rule="required" class="form-control" size="50" name="row[content][video]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-maxsize="10M" data-input-id="c-content-video" data-mimetype="mp4" data-multiple="false" data-preview-id="p-content-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-maxsize="10M" data-input-id="c-content-video" data-mimetype="mp4" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-content-video"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-content-video"></ul>
            <span class="help-block">临时素材有效期3天需要添加定时任务更新有效期，建议30分钟执行一次。</span>
            <span class="help-block">定时任务访问URL：{:request()->domain()}/addons/weixin/index/updateMaterial</span>
        </div>
    </div>
    <div class="form-group" data-favisible="reply_type='video'">
        <label class="control-label col-xs-12 col-sm-2">{:__('视频标题')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-video_title" data-rule="required;length(~200, true)" class="form-control" name="row[content][video_title]" type="text" value="">
        </div>
    </div>
    <div class="form-group" data-favisible="reply_type='video'">
        <label class="control-label col-xs-12 col-sm-2">{:__('视频描述')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-video_description-text" style="height: 200px;" data-rule="required" aria-invalid="true" class="form-control" name="row[content][video_description]"></textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
            {foreach name="statusList" item="vo"}
                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>